<template>
  <div id="carInfo" v-show="isShow">
    <div class="close" @click="closePane">×</div>
    <div class="title">车位详情</div>
    <div class="content">
      <el-form ref="form" :model="form" label-width="110px">
        <el-form-item label="编号">
          <el-input v-model="form.id" readonly></el-input>
        </el-form-item>
        <el-form-item label="已用">
          <el-input v-model="form.used" readonly></el-input>
        </el-form-item>
        <el-form-item label="可用">
          <el-input v-model="form.free" readonly></el-input>
        </el-form-item>
        <el-form-item label="总数">
          <el-input v-model="form.count" readonly></el-input>
        </el-form-item>
        <el-form-item label="类型">
          <el-input v-model="form.type" readonly></el-input>
        </el-form-item>
      </el-form>
    </div>
  </div>
</template>
<script>
export default {
  data() {
    return {
      isShow: false,
      form: {},
    };
  },
  mounted() {
    window.showCarInfo = this.carInfo;
  },
  methods: {
    // 接收传送过来的信息
    carInfo(val) {
      this.isShow = true;
      this.form = val;
    },
    // 关闭弹窗
    closePane() {
      this.isShow = false;
      window.Sgworld.execute(
        "grapi",
        "ParkingLot",
        { visibility: false },
        null
      );
      // 飞回特定视角
      window.Sgworld.flyTo(
        16.826513290405273,
        -125.1737289428711,
        70.27117919921875,
        0.000004626484042091761,
        -42.4249267578125,
        93.60037994384766,
        10401.529296875,
        () => {},
        4
      );
    },
  },
};
</script>
<style scoped>
#carInfo {
  margin: 0 auto;
  box-sizing: border-box;
  position: absolute;
  left: 38%;
  top: 200px;
  width: 962px;
  height: 1078px;
  color: white;
  background: url("../../../static/images/popups/detailsPane.png") !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
  background-size: 100% 100% !important;
  transition: all 1.2s;
}
/* 右上角关闭按钮 */
.close {
  float: right;
  font-size: 50px;
  font-weight: 900;
  margin-right: 70px;
  margin-top: 70px;
  transition: all 1s;
}
.close:hover {
  transform: scale(1.1);
  color: red;
  cursor: pointer;
}
.content {
  box-sizing: border-box;
  width: 100%;
  padding: 100px;
  margin-top: 150px;
}
.title {
  position: absolute;
  left: 110px;
  top: 30px;
  font-size: 32px;
  font-weight: 800;
}
</style>